package cn.ncu.wechat.dao;

import cn.ncu.wechat.model.DailyStat;
import cn.ncu.wechat.model.Overview;
import cn.ncu.wechat.model.StoreStat;
import cn.ncu.wechat.model.Verification;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
* @author 
* @description 针对表【verification】的数据库操作Mapper
* @createDate 2025-02-22 21:28:49
* @Entity cn.ncu.wechat.model.Verification
*/
public interface VerificationMapper extends BaseMapper<Verification> {
    @Select("select o.order_no,o.product_name,u.phone,u.nick_name,o.verification_time "+
            " from verification v" +
            " left join orders o on o.order_no = v.order_no" +
            " join user u on u.id = o.user_id" +
            " where v.verification_code = #{verificationCode}")
    Map<String,Object> check(String verificationCode);


    ArrayList<StoreStat> getStoreStats(@Param("startDate") String startDate,
                                            @Param("endDate") String endDate,
                                            @Param("storeId") Long storeId);

    Overview getOverView(@Param("startDate") String startDate,
                         @Param("endDate") String endDate
                         );

    ArrayList<DailyStat> getDailyStat(@Param("startDate") String startDate,
                                      @Param("endDate") String endDate);
}




